<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>文档标题</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/static/jquery/jquery.mobile-1.4.5.css">
    <script src="/static/js/jquery-1.12.4.min.js"></script>
    <script src="/static/jquery/jquery.mobile-1.4.5.js"></script>
</head>

<body>
    <div data-role="page">
        <div data-role="panel" data-position="right" id="myPanel">
            <h2>{{ userinfo.nicename }}</h2>
            <ul data-role="listview">
                <li data-icon="heart"><a href="#">{{ userinfo.basename }}</a></li>
                <li data-icon="user"><a href="#">{{ userinfo.face }}</a></li>
                <li data-icon="phone"><a href="#">{{ userinfo.phone }}</a></li>
                <li data-icon="mail"><a href="#">{{ userinfo.email }}</a></li>
                <li data-icon="clock"><a href="#">{{ userinfo.creatime }}</a></li>
                <li data-icon="clock"><a href="#">{{ userinfo.lastime }}</a></li>
            </ul>
        </div>

        <div data-role="header">
            <!-- <a href="#" class="ui-btn ui-icon-home ui-btn-icon-left">主页</a> -->
            <h1>欢迎来到我的主页</h1>
            <a href="#myPanel" class="ui-btn ui-btn-right ui-icon-user ui-btn-icon-left">{{ userinfo.nicename }}</a>
        </div>

        <div data-role="main" class="ui-content">
            <div data-role="collapsible" data-collapsed="false">
                <h1>门店列表</h1>
                <p>
                    <input type="text" name="search" id="search" placeholder="search">
                    <a href="#" data-role="button" data-rel="push">刷新</a>
                </p>
                <table data-role="main" class="ui-content" id="myTablePlace">
                    <tbody></tbody>
                </table>
            </div>
            <div data-role="collapsible">
                <h1>员工模块</h1>
                <p>我是可折叠的内容。</p>
            </div>
            <div data-role="collapsible">
                <h1>作业项模块</h1>
                <p>我是可折叠的内容。</p>
            </div>
            <div data-role="collapsible">
                <h1>呼叫模块</h1>
                <p>我是可折叠的内容。</p>
            </div>
            <div data-role="collapsible">
                <h1>清洁模块</h1>
                <p>我是可折叠的内容。</p>
            </div>
            <div data-role="collapsible">
                <h1>系统设置</h1>
                <p>我是可折叠的内容。</p>
            </div>
        </div>

        <div data-role="footer">
            <h1>底部文本</h1>
        </div>


    </div>
</body>
<script>
    $(document).ready(function () {
        // 用户token
        var token = localStorage.getItem("token");
        // 设置请求头
        $.ajaxSetup({ headers: { "Authorization": "Bearer " + token } });
        // 请求场所列表
        $.ajax({
            url: "/place/battrs/",
            type: "get",
            success: function (res) {
                console.log(res);
                var r = $("#myTablePlace").find("tbody");
                r.empty();
                $.each(res.resmsg, function (i, item) {
                    r.append("<tr><td>" + item.id + "</td><td>" + item.basename + "</td><td>" + item.status + "</td><td><a href='#' onclick='delPlace(" + item.place_id + ")'>删除</a></td></tr>");
                }
                );
                //console.log(r);
            },
            error: function (res) { console.log(res); }
        });

    });
</script>

</html>